import { createRouter, createWebHistory } from 'vue-router'
import Employees from '../views/Employees.vue'
import Projects from '../views/Projects.vue'
import WorkExperience from '../views/WorkExperience.vue'
import Templates from '../views/Templates.vue'
import Contracts from '../views/Contracts.vue'
import Certificates from '../views/Certificates.vue'
import CertificateNames from '../views/Certificate/CertificateNames.vue'
import RewardPunishmentManage from '../views/RewardPunishmentManage.vue'
import DictManage from '../views/DictManage.vue'

const routes = [
  {
    path: '/',
    redirect: '/employees'
  },
  {
    path: '/employees',
    name: 'Employees',
    component: Employees
  },
  {
    path: '/employees/:employeeId',
    component: {
      template: '<router-view></router-view>'
    },
    children: [
      {
        path: 'projects',
        name: 'Projects',
        component: Projects
      },
      {
        path: 'work-experience',
        name: 'WorkExperience',
        component: WorkExperience
      }
    ]
  },
  {
    path: '/templates',
    name: 'Templates',
    component: Templates
  },
  {
    path: '/contracts',
    name: 'Contracts',
    component: Contracts
  },
  {
    path: '/certificates',
    name: 'Certificates',
    component: Certificates
  },
  {
    path: '/certificate-names',
    name: 'CertificateNames',
    component: CertificateNames
  },
  {
    path: '/reward-punishments',
    name: 'RewardPunishmentManage',
    component: RewardPunishmentManage
  },
  {
    path: '/dict-manage',
    name: 'DictManage',
    component: DictManage
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 